package com.shengyin.ec.model.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * Roles entity. @author MyEclipse Persistence Tools
 */

@Entity
@Table(name="Roles")
public class Roles extends BaseEntity implements java.io.Serializable {

	// Fields

	private boolean enable;
	private String name;
	
	@ManyToMany(mappedBy="roles",fetch=FetchType.EAGER)
	private Set<Users> users = new HashSet<Users>(0);
	
	@ManyToMany(fetch=FetchType.EAGER)
	private Set<Resources> resources = new HashSet<Resources>(0);
	
	/** default constructor */
	public Roles() {
	}


	public Set<Resources> getResources() {
		return resources;
	}


	public void setResources(Set<Resources> resources) {
		this.resources = resources;
	}


	public Set<Users> getUsers() {
		return users;
	}


	public void setUsers(Set<Users> users) {
		this.users = users;
	}


	public boolean getEnable() {
		return this.enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}


}